package com.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.util.*;

public class UseServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public UseServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String name = request.getParameter("name"); // name,title,mail,msg
		String title = request.getParameter("title");
		String mail = request.getParameter("mail");
		String msg = request.getParameter("msg");
		name = (name == null) ? "" : name;
		title = (title == null) ? "" : title;
		mail = (mail == null) ? "" : mail;
		msg = (msg == null) ? "" : msg;
		System.out.println("Servlet OK");

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

	/**
	 * Initialization of the servlet. <br>
	 * 
	 * @throws ServletException
	 *             if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
